package com.example.demo.pattern.proxypattern;

public class PersonBeanImpl implements PersonBean{
    private String name;
    private int rating;
    private int ratingCount;

    @Override
    public String getName() {
        return this.name;
    }

    @Override
    public void setName(String name) {
        this.name = name;
    }

    @Override
    public int getHotOrNotRating() {
        if (ratingCount > 0) {
            return rating / ratingCount;
        }
        return 0;
    }

    @Override
    public void setHotOrNotRating(int rating) {
        this.rating += rating;
        ratingCount++;
    }
}
